// 引入路由模块
import VueRouter from 'vue-router'
import Vue from 'vue'

// 注册 VueRouter构造函数 到vue系统中
Vue.use(VueRouter)

import HeroList from '../views/HeroListVue.vue'
import HeroAdd from '../views/HeroAdd.vue'
import HeroEdit from '../views/HeroEdit.vue'
import EM from '../views/equipment.vue'
import skill from '../views/skill.vue'

// 定义路径和组件的对应关系  （定义的路由是 数组）
const routes = [
    {
        path: '/heroList',
        component: HeroList
    },
    {
        path: '/heroAdd',
        component: HeroAdd
    },
    {
        path: '/heroEdit',
        component: HeroEdit
    },
    {
        path: '/equipment',
        component: EM
    },
    {
        path: '/skill',
        component: skill
    }
]

// 3.实例化 vuerouter 
const router = new VueRouter({
    routes
});

// 4.将 router 导出
export default router